From 1df0d8953a3510f7debafeecbce1b49b06ee5b3c Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 12 Jul 2005 13:19:10 +0000 Subject: [PATCH] Fix DMA compile for x86_64. Signed-off-by: Xin Li --- linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c | 4 ++-- .../include/asm-xen/asm-x86_64/dma-mapping.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c index e8f80155a2..b21c7df4f0 100644 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c @@ -231,7 +231,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size, * boundary. Take into account buffer start offset. All other calls are * conservative and always search the dma_map list if it's non-empty. */ - if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) { + if (((((unsigned long)ptr) & ~PAGE_MASK) + size) <= PAGE_SIZE) { dma = virt_to_bus(ptr); } else { BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL); @@ -247,7 +247,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size, spin_unlock_irqrestore(&dma_map_lock, flags); } - if ((dma+size) & ~*hwdev->dma_mask) + if ((dma+size) & ~*dev->dma_mask) out_of_line_bug(); return dma; } diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h index 295183bbaf..b280f92ad9 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h @@ -22,20 +22,20 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); extern dma_addr_t dma_map_single(struct device *hwdev, void *ptr, size_t size, - int direction); + enum dma_data_direction direction); extern void dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size, - int direction); + enum dma_data_direction direction); #define dma_map_page(dev,page,offset,size,dir) \ dma_map_single((dev), page_address(page)+(offset), (size), (dir)) extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, - int direction); + enum dma_data_direction direction); extern void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, - int direction); + enum dma_data_direction direction); static inline void dma_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, -- 2.30.2